package com.loan.mappers;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.loan.entity.Contract;
import org.apache.ibatis.annotations.*;

import java.math.BigDecimal;
import java.util.List;
/**
 * @ClassName: ContractMapper
 * @Author: wYin
 * @Date: 2022/1/19 18:59
 */
public interface ContractMapper extends BaseMapper<Contract> {

    /**
     * 功能描述: <br>
     * 查询合同表中是否包含当前合同编号
     * @Param: [number]
     * @Return: int
     * @Author: wYin
     * @Date: 2022/1/18 12:09
     */
    @Select("select count(*) from contract where number = #{number}")
    public int getNumber(String number);

    /**
     * 功能描述: <br>
     * 根据合同编号修改放款状态--改为放款
     * @Param: [number]
     * @Return: int
     * @Author: wYin
     * @Date: 2022/1/18 18:40
     */
    @Update("update contract set loan='y',debt=#{debt} where number = #{number}")
    public int updateLoan(BigDecimal debt,String number);


}
